<?php
$dir="..";
if(!is_dir($dir."/.git"))
{
    $dir="../..";
}
$cmd="cd $dir && git commit -am 'gs'";
echo $cmd."\n";
$out=null;
exec($cmd,$out);
print_r($out);
$cmd="cd $dir && git push origin master";
echo $cmd."\n";
$out=null;
exec($cmd,$out);
print_r($out);